﻿#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QObject>
#include <QThread>
#include <QRunnable>
#include <QTcpSocket>
#include <QDebug>
#include <QEventLoop>

class myThread : public QObject,public QRunnable
{
    Q_OBJECT
public:
    explicit myThread(QTcpSocket *s);
    void run()override;

public slots:
    void senddata_to(QByteArray Data);

signals:
    void dataReady(QByteArray recvdata);
    void disconnected(myThread* thread);

    void finished(); // 新增完成信号

private:
    QTcpSocket *mysocket;
};

#endif // MYTHREAD_H
